import requests
import json

def test_qa_system():
    """Test Q&A functionality"""
    url = 'http://localhost:5000/api/qa/ask'
    
    question = "What is the definition of a medical device according to FDA regulations?"
    
    payload = {
        'question': question
    }
    
    response = requests.post(
        url,
        headers={'Content-Type': 'application/json'},
        data=json.dumps(payload)
    )
    
    print(f"Status: {response.status_code}")
    print(f"Response: {json.dumps(response.json(), indent=2)}")

if __name__ == "__main__":
    test_qa_system()